<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="./include/login.css">
</head>

<script>
		function check_login(){
			if(login_form.u.value.length == 0){
				alert('登录账号必填！');
				// 返回表单用户控件光标（焦点）
				return login_form.u.focus();
			}else if(login_form.p.value.length == 0){
				alert('登录密码必填！');
				return login_form.p.focus();
			}else{
				// 提交表单 action 指定文件
				login_form.submit();
			}
		}
	</script>

<body>
	
		<div class="container">
		<div class="content">
			<h3>用户登录</h3>
			<form method="post" name="login_form" class="login_form" action="check_login.php">
				<!-- <input type="text" name="u" class="u" placeholder="请输入账号" required title="账号必填"> -->
				<input type="text" name="u" class="u" placeholder="请输入账号">
				<!-- <input type="password" name="p"  class="p" placeholder="请输入密码" required title="账号必填"> -->
				<input type="password" name="p"  class="p" placeholder="请输入密码">
				<input type="button" id="btn" value="登录" onclick="check_login()">
			</form>
			<div class="linkbar"><a href="reg.php">注册新用户</a><a href="index.php">返回主页</a></div>
		</div>
	</div>

</body>
</html>